// 自动生成模板FdArticleLearn
package hierarchy

import (
	"gitcode.com/G-YT/iHealth25/server/global"
)

// FdArticleLearn 结构体
type FdArticleLearn struct {
	global.GVA_MODEL
	LevelOneID       *int              `json:"levelOneID" form:"levelOneID" gorm:"column:level_one_id;comment:类别id                           tips：用于记录所属分类1;size:10;"`
	LevelOne         *LevelOne         `json:"levelOne" form:"levelOne" gorm:"foreignKey:LevelOneID;references:ID;comment:;"`
	LevelTwoID       *int              `json:"levelTwoID" form:"levelTwoID" gorm:"column:level_two_id;comment:;size:19;"`
	LevelTwo         *LevelTwo         `json:"levelTwo" form:"levelTwo" gorm:"foreignKey:LevelTwoID;references:ID;comment:;"`
	LevelThreeID     *int              `json:"levelThreeID" form:"levelThreeID" gorm:"column:level_three_id;comment:三级标识;"`
	LevelThree       *LevelThree       `json:"levelThree" form:"levelThree" gorm:"foreignKey:LevelThreeID;references:ID;comment:;"`
	FdArticleLike    *FdArticleLike    `json:"-" form:"-" gorm:"->;foreignKey:FdArticleID;references:ID;comment:;"`
	FdArticleCollect *FdArticleCollect `json:"-" form:"-" gorm:"->;foreignKey:FdArticleID;references:ID;comment:;"`
	BuyArticle       *BuyArticle       `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;comment:;"`
	Title            string            `json:"title" form:"title" gorm:"column:title;comment:标题;size:191;"`
	Briefly          string            `json:"briefly" form:"briefly" gorm:"column:briefly;comment:简介;size:191;"`
	Cover            string            `json:"cover" form:"cover" gorm:"column:cover;comment:封面;size:191;"`
	VideoLink        string            `json:"videoLink" form:"videoLink" gorm:"column:video_link;comment:视频链接;size:191;"`
	Image            string            `json:"image" form:"image" gorm:"column:image;comment:训练器械;size:191;"`
	Details          string            `json:"details" form:"details" gorm:"column:details;comment:详情;type:text;"`
	Status           *bool             `json:"status" form:"status" gorm:"column:status;comment:状态 1上架 0下架;"`
	IsPaid           *bool             `json:"isPaid" form:"isPaid" gorm:"column:is_paid;comment:是否付费 1是 0不是;"`
	PV               int               `json:"pv" form:"pv" gorm:"column:pv;comment:浏览量;size:19;"`
	SearchNumber     int               `json:"searchNumber" form:"searchNumber" gorm:"column:search_number;comment:搜索量;size:19;"`
	PraiseNum        int               `json:"praiseNum" form:"praiseNum" gorm:"column:praise_num;comment:点赞量;size:19;"`
	CollectNum       int               `json:"collectNum" form:"collectNum" gorm:"column:collect_num;comment:收藏量;size:19;"`
	ForwardNum       int               `json:"forwardNum" form:"forwardNum" gorm:"column:forward_num;comment:转发量;size:19;"`
	CommentNum       int               `json:"comment_num" form:"comment_num" gorm:"column:comment_num;comment:评论量;size:19;"`
	IsPraise         bool              `json:"isPraise" form:"isPraise" gorm:"-"`
	IsCollect        bool              `json:"isCollect" form:"isCollect" gorm:"-"`
	BuyStatus        bool              `json:"buyStatus" form:"buyStatus" gorm:"-"`
}

type BuyArticle struct {
	HmID           uint            `json:"hm_id" gorm:"column:hmID;"`
	ArticleID      uint            `json:"article_id" gorm:"column:article_id;"`
	FdArticleLearn *FdArticleLearn `json:"-" form:"-" gorm:"->;foreignKey:ArticleID;references:ID;"` // 关联学习文章
}

func (FdArticleLearn) TableName() string {
	return "fd_article_learn"
}

func (BuyArticle) TableName() string {
	return "fd_buy_article"
}
